package qianting.news.user.feign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import qianting.news.apis.models.user.pojos.ApUser;
import qianting.news.apis.services.user.IUserClient;
import qianting.news.common.entity.State;
import qianting.news.user.service.ApUserService;

@RestController
@RequestMapping("/api")
public class UserClient implements IUserClient {

    @Autowired
    private ApUserService apUserService;

    //根据id查询用户
    @GetMapping("getUserById")
    public State getUserById(@RequestParam("id") Long id){

        ApUser user = apUserService.getById(id);
        user.setPassword("");
        return State.succ(user);

    }

}
